<?
if (($c = stack('name')) && ($g = (int)param('gallery'))) {

	$s = array_extend( array('path' => 'album', 'tn' => FP_TN_DIR, 'w' => 800, 'h' => 600, 'tnw' => 96, 'tnh' => 96, 'gw' => 96, 'gh' => 96, 'caption' => ''), $DATA['components'][$c]['settings']);
	$s['path'] = $DATA['components'][$c]['settings']['path'] = FP_UPLOAD_PATH."$s[path]/$g";

	$t = datafetch_array('meta', D_MB_META, $g, context('lang'));
	$DATA['components'][$c]['settings']['gallery-title'] = $t['title'];

	$DATA['components'][$c]['data'] = datafetch_array('gallery2', $s['path']);	// load existing images list

	unstack();
}

?>